home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / SGINT23.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  7KB  |  180 lines

  1. /* $Id: sgint23.h,v 1.2 1998/03/11 11:58:36 ralf Exp $
  2.  * sgint23.h: Defines for the SGI INT2 and INT3 chipsets.
  3.  *
  4.  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  5.  */
  6. #ifndef _MIPS_SGINT23_H
  7. #define _MIPS_SGINT23_H
  8.  
  9. /* These are the virtual IRQ numbers, we divide all IRQ's into
  10.  * 'spaces', the 'space' determines where and how to enable/disable
  11.  * that particular IRQ on an SGI machine.  Add new 'spaces' as new
  12.  * IRQ hardware is supported.
  13.  */
  14. #define SGINT_LOCAL0   0   /* INDY has 8 local0 irq levels */
  15. #define SGINT_LOCAL1   8   /* INDY has 8 local1 irq levels */
  16. #define SGINT_LOCAL2   16  /* INDY has 8 local2 vectored irq levels */
  17. #define SGINT_LOCAL3   24  /* INDY has 8 local3 vectored irq levels */
  18. #define SGINT_GIO      32  /* INDY has 9 GIO irq levels */
  19. #define SGINT_HPCDMA   41  /* INDY has 11 HPCDMA irq _sources_ */
  20. #define SGINT_END      52  /* End of 'spaces' */
  21.  
  22. /* INT2 occupies HPC PBUS slot 4, INT3 uses slot 6. */
  23. #define SGI_INT2_BASE 0x1fb80100 /* physical */
  24. #define SGI_INT3_BASE 0x1fbd9880 /* physical */
  25.  
  26. struct sgi_ioc_ints {
  27. #ifdef __MIPSEB__
  28.     unsigned char _unused0[3];
  29.     volatile unsigned char istat0;    /* Interrupt status zero */
  30. #else
  31.     volatile unsigned char istat0;    /* Interrupt status zero */
  32.     unsigned char _unused0[3];
  33. #endif
  34. #define ISTAT0_FFULL           0x01
  35. #define ISTAT0_SCSI0           0x02
  36. #define ISTAT0_SCSI1           0x04
  37. #define ISTAT0_ENET            0x08
  38. #define ISTAT0_GFXDMA          0x10
  39. #define ISTAT0_LPR             0x20
  40. #define ISTAT0_HPC2            0x40
  41. #define ISTAT0_LIO2            0x80
  42.  
  43. #ifdef __MIPSEB__
  44.     unsigned char _unused1[3];
  45.     volatile unsigned char imask0;    /* Interrupt mask zero */
  46.     unsigned char _unused2[3];
  47.     volatile unsigned char istat1;    /* Interrupt status one */
  48. #else
  49.     volatile unsigned char imask0;    /* Interrupt mask zero */
  50.     unsigned char _unused1[3];
  51.     volatile unsigned char istat1;    /* Interrupt status one */
  52.     unsigned char _unused2[3];
  53. #endif
  54. #define ISTAT1_ISDNI           0x01
  55. #define ISTAT1_PWR             0x02
  56. #define ISTAT1_ISDNH           0x04
  57. #define ISTAT1_LIO3            0x08
  58. #define ISTAT1_HPC3            0x10
  59. #define ISTAT1_AFAIL           0x20
  60. #define ISTAT1_VIDEO           0x40
  61. #define ISTAT1_GIO2            0x80
  62.  
  63. #ifdef __MIPSEB__
  64.     unsigned char _unused3[3];
  65.     volatile unsigned char imask1;    /* Interrupt mask one */
  66.     unsigned char _unused4[3];
  67.     volatile unsigned char vmeistat;  /* VME interrupt status */
  68.     unsigned char _unused5[3];
  69.     volatile unsigned char cmeimask0; /* VME interrupt mask zero */
  70.     unsigned char _unused6[3];
  71.     volatile unsigned char cmeimask1; /* VME interrupt mask one */
  72.     unsigned char _unused7[3];
  73.     volatile unsigned char cmepol;    /* VME polarity */
  74. #else
  75.     volatile unsigned char imask1;    /* Interrupt mask one */
  76.     unsigned char _unused3[3];
  77.     volatile unsigned char vmeistat;  /* VME interrupt status */
  78.     unsigned char _unused4[3];
  79.     volatile unsigned char cmeimask0; /* VME interrupt mask zero */
  80.     unsigned char _unused5[3];
  81.     volatile unsigned char cmeimask1; /* VME interrupt mask one */
  82.     unsigned char _unused6[3];
  83.     volatile unsigned char cmepol;    /* VME polarity */
  84.     unsigned char _unused7[3];
  85. #endif
  86. };
  87.  
  88. struct sgi_ioc_timers {
  89. #ifdef __MIPSEB__
  90.     unsigned char _unused0[3];
  91.     volatile unsigned char tcnt0;  /* counter 0 */
  92.     unsigned char _unused1[3];
  93.     volatile unsigned char tcnt1;  /* counter 1 */
  94.     unsigned char _unused2[3];
  95.     volatile unsigned char tcnt2;  /* counter 2 */
  96.     unsigned char _unused3[3];
  97.     volatile unsigned char tcword; /* control word */
  98. #else
  99.     volatile unsigned char tcnt0;  /* counter 0 */
  100.     unsigned char _unused0[3];
  101.     volatile unsigned char tcnt1;  /* counter 1 */
  102.     unsigned char _unused1[3];
  103.     volatile unsigned char tcnt2;  /* counter 2 */
  104.     unsigned char _unused2[3];
  105.     volatile unsigned char tcword; /* control word */
  106.     unsigned char _unused3[3];
  107. #endif
  108. };
  109.  
  110. /* Timer control word bits. */
  111. #define SGINT_TCWORD_BCD    0x01 /* Use BCD mode for counters */
  112. #define SGINT_TCWORD_MMASK  0x0e /* Mode bitmask. */
  113. #define SGINT_TCWORD_MITC   0x00 /* IRQ on terminal count (doesn't work) */
  114. #define SGINT_TCWORD_MOS    0x02 /* One-shot IRQ mode. */
  115. #define SGINT_TCWORD_MRGEN  0x04 /* Normal rate generation */
  116. #define SGINT_TCWORD_MSWGEN 0x06 /* Square wave generator mode */
  117. #define SGINT_TCWORD_MSWST  0x08 /* Software strobe */
  118. #define SGINT_TCWORD_MHWST  0x0a /* Hardware strobe */
  119. #define SGINT_TCWORD_CMASK  0x30 /* Command mask */
  120. #define SGINT_TCWORD_CLAT   0x00 /* Latch command */
  121. #define SGINT_TCWORD_CLSB   0x10 /* LSB read/write */
  122. #define SGINT_TCWORD_CMSB   0x20 /* MSB read/write */
  123. #define SGINT_TCWORD_CALL   0x30 /* Full counter read/write */
  124. #define SGINT_TCWORD_CNT0   0x00 /* Select counter zero */
  125. #define SGINT_TCWORD_CNT1   0x40 /* Select counter one */
  126. #define SGINT_TCWORD_CNT2   0x80 /* Select counter two */
  127. #define SGINT_TCWORD_CRBCK  0xc0 /* Readback command */
  128.  
  129. #define SGINT_TCSAMP_COUNTER  10255
  130.  
  131. struct sgi_int2_regs {
  132.     struct sgi_ioc_ints ints;
  133.  
  134.     volatile unsigned long ledbits;   /* LED control bits */
  135. #define INT2_LED_TXCLK         0x01       /* GPI to TXCLK enable */
  136. #define INT2_LED_SERSLCT0      0x02       /* serial port0: 0=apple 1=pc */
  137. #define INT2_LED_SERSLCT1      0x04       /* serial port1: 0=apple 1=pc */
  138. #define INT2_LED_CHEAPER       0x08       /* 0=cheapernet 1=ethernet */
  139. #define INT2_LED_POWEROFF      0x10       /* Power-off request, active high */
  140.  
  141. #ifdef __MIPSEB__
  142.     unsigned char _unused0[3];
  143.     volatile unsigned char tclear;    /* Timer clear strobe address */
  144. #else
  145.     volatile unsigned char tclear;    /* Timer clear strobe address */
  146.     unsigned char _unused0[3];
  147. #endif
  148. #define INT2_TCLEAR_T0CLR      0x1        /* Clear timer0 IRQ */
  149. #define INT2_TCLEAR_T1CLR      0x2        /* Clear timer1 IRQ */
  150.  
  151.     unsigned long _unused[3];
  152.     struct sgi_ioc_timers timers;
  153. };
  154.  
  155. struct sgi_int3_regs {
  156.     struct sgi_ioc_ints ints;
  157.  
  158. #ifdef __MIPSEB__
  159.     unsigned char _unused0[3];
  160.     volatile unsigned char tclear;    /* Timer clear strobe address */
  161. #else
  162.     volatile unsigned char tclear;    /* Timer clear strobe address */
  163.     unsigned char _unused0[3];
  164. #endif
  165.     volatile unsigned long estatus;   /* Error status reg */
  166.     unsigned long _unused1[2];
  167.     struct sgi_ioc_timers timers;
  168. };
  169.  
  170. extern struct sgi_int2_regs *sgi_i2regs;
  171. extern struct sgi_int3_regs *sgi_i3regs;
  172. extern struct sgi_ioc_ints *ioc_icontrol;
  173. extern struct sgi_ioc_timers *ioc_timers;
  174. extern volatile unsigned char *ioc_tclear;
  175.  
  176. extern void sgint_init(void);
  177. extern void indy_timer_init(void);
  178.  
  179. #endif /* !(_MIPS_SGINT23_H) */
  180.